package common.dal;

/**
 * A where clause operator, to be used by {@link WhereEntry}
 * 
 * @author Gal Lalouche
 */
public enum WhereOperator {
	/**
	 * for {@code IS NULL} check
	 */
	IS,
	/**
	 * for {@code IS NOT NULL} check
	 */
	IS_NOT,
	/**
	 * for all equality checks (will be translated to {@code =})
	 */
	EQUALS,
	/**
	 * for all arithmetic less than checks (Will be translated to {@code <=})
	 */
	LESS_THAN,
	/**
	 * for all arithmetic greater than checks (Will be translated to {@code >=})
	 */
	GREATER_THAN;
	
	@Override
	public String toString() {
		switch (this) {
		case EQUALS:
			return "=";
		case IS_NOT:
			return "IS NOT";
		case LESS_THAN:
			return "<=";
		case GREATER_THAN:
			return ">=";
		default:
			return super.toString();
		}
	}
}
